import Vue from 'vue';
import App from './App.vue';

import moment from '../src/kits/moment';
Vue.filter('dateformat', function (input, formatStr) {
    return moment(input).format(formatStr);
})
import vueRouter from 'vue-router';
Vue.use(vueRouter);

//导入路由组件import home from './components/Home.vue';
import home from './components/home.vue';
import newslist from './components/news/newslist.vue';
import newsinfo from './components/news/newsinfo.vue';
import photolist from './components/photosharing/photolist.vue';
import photoinfo from './components/photosharing/photoinfo.vue'

//定义路由规则
let router = new vueRouter({
    linkActiveClass: 'mui-active',
    routes: [
        { path: '/', redirect: '/home' },
        {
            path: '/home', component: home
        },
        {
            path: '/news/newslist', component: newslist
        },
        {
            path: '/news/newsinfo/:id', component: newsinfo
        },
        {
            path: '/photo/photolist', component: photolist
        },
        {
            path: '/photo/photoinfo/:id', component: photoinfo
        }
    ]
})

//引入Vue-router在Vue中进行绑定,自动在Vue实例上注入一个$http对象就可以使用ajax方法请求数据了
import vueResource from 'vue-resource';
Vue.use(vueResource);
// import '../statics/css/site.css';
import '../statics/css/site.css'
import 'mint-ui/lib/style.min.css';
import mintui from 'mint-ui';
Vue.use(mintui);
import '../statics/mui/css/mui.css';

new Vue({
    el: '#app',
    router: router,
    render: c => c(App)
})